﻿<Window x:Class="VNet.VisiSuite.VisiBoard.Views.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vuc="clr-namespace:VNet.VisiSuite.Controls;assembly=VNet.VisiSuite.Controls"
        xmlns:controls="clr-namespace:WpfKb.Controls;assembly=WpfKb"
        WindowStartupLocation="CenterScreen" Icon="../Assets/Icons/WorkRite.ico"
        x:Name="MainWin"
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!-- Metro Light Theme -->
                <ResourceDictionary Source="../Assets/Themes/Metro/Metro.MSControls.Core.Implicit.xaml" />
                <ResourceDictionary Source="../Assets/Styles/AppStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Storyboard x:Key="_show_keyboard">
                <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="_keyboard" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                <DoubleAnimation Storyboard.TargetName="_keyboard_translate" Storyboard.TargetProperty="X" To="0" Duration="00:00:00.6" BeginTime="00:00:00">
                    <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetName="_keyboard_translate" Storyboard.TargetProperty="Y" To="0" Duration="00:00:00.6" BeginTime="00:00:00">
                    <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
            </Storyboard>

            <Storyboard x:Key="_hide_keyboard">
                <DoubleAnimation Storyboard.TargetName="_keyboard_translate" Storyboard.TargetProperty="X" From="0" Duration="00:00:00.6" BeginTime="00:00:00">
                    <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetName="_keyboard_translate" Storyboard.TargetProperty="Y" From="0" Duration="00:00:00.6" BeginTime="00:00:00">
                    <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                
                <ObjectAnimationUsingKeyFrames BeginTime="0:0:0.6" Duration="0:0:0" Storyboard.TargetName="_keyboard" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>


            <Storyboard x:Key="_show_dialog">
                <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetName="_dialog" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
                <DoubleAnimation Storyboard.TargetName="_dialog_translate" Storyboard.TargetProperty="X" To="0" Duration="00:00:00.6">
                    <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
            </Storyboard>

            <Storyboard x:Key="_hide_dialog">
                <DoubleAnimation Storyboard.TargetName="_dialog_translate" Storyboard.TargetProperty="X" To="375" Duration="00:00:00.6">
                    <DoubleAnimation.EasingFunction>
                        <CircleEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <ObjectAnimationUsingKeyFrames BeginTime="0:0:0.6" Duration="0:0:0" Storyboard.TargetName="_dialog" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Collapsed}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
            
        </ResourceDictionary>
    </Window.Resources>
    <Grid Background="{StaticResource WhiteColor}" Focusable="False" x:Name="_main_Grid">

        <vuc:TopSlidePanel x:Name="_topPanel" Focusable="False" />
        <vuc:BottomSlidePanel x:Name="_bottomPanel" Focusable="False" />

        <ContentControl x:Name="_content1" IsEnabled="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="100" Focusable="False">
            <ContentControl.RenderTransform>
                <TransformGroup>
                    <TranslateTransform x:Name="_content1Translate" X="0" Y="0" />
                </TransformGroup>
            </ContentControl.RenderTransform>
        </ContentControl>

        <ContentControl x:Name="_content2" IsEnabled="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="0" Focusable="False">
            <ContentControl.RenderTransform>
                <TransformGroup>
                    <TranslateTransform x:Name="_content2Translate" X="0" Y="0" />
                </TransformGroup>
            </ContentControl.RenderTransform>
        </ContentControl>

        <!-- Right panel -->
        <Grid x:Name="_dialog" HorizontalAlignment="Right" VerticalAlignment="Stretch"  Width="375" Panel.ZIndex="500" Background="Transparent" Visibility="Hidden" >
            <ContentControl x:Name="_dialog_content" IsEnabled="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="False">
                <ContentControl.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform x:Name="_dialog_translate" X="375" Y="0" />
                    </TransformGroup>
                </ContentControl.RenderTransform>
            </ContentControl>
        </Grid>
        
        <Grid Panel.ZIndex="500">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="375" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="3*"/>
                <RowDefinition Height="2*"/>
            </Grid.RowDefinitions>
            <Border  x:Name="_keyboard" Grid.Column="0" Grid.Row="1" Visibility="Collapsed">
                <Border.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform x:Name="_keyboard_translate"/>
                    </TransformGroup>
                </Border.RenderTransform>
                <controls:Windows8Keyboard/>
            </Border>
        </Grid>
    </Grid>
</Window>
